(defrule forall-test-2
  (not (and (a ?x) (not (b ?x))))
  =>
  (printout t ">>> FIRED 1" crlf))


(deffunction test-something ()
  (reset)
  (printout t "No facts" crlf)
  (run)
  (reset)
  (printout t "One A" crlf)
  (assert (a 1))
  (run)
  (reset)
  (printout t "One A, matching B" crlf)
  (assert (a 1) (b 1))
  (run)
  (reset)
  (printout t "One A, non-matching B" crlf)
  (assert (a 1) (b 2))
  (run)
  (reset)
  (printout t "One pair, extra A" crlf)
  (assert (a 1) (b 1) (a 2))
  (run)
  (reset)
  (printout t "One pair, A, nonmatching B" crlf)
  (assert (a 1) (b 1) (a 2) (b 3))
  (run)
  (reset)
  (printout t "Two pairs" crlf)
  (assert (a 1) (b 1) (a 2) (b 2))
  (run)
  (reset)
  (printout t "One B" crlf)
  (assert (b 2))
  (run)
  (reset)
  (printout t "One pair, One B" crlf)
  (assert (a 1) (b 1) (b 2))
  (run)
  (reset)
  )


(printout t "Testing forall CE :" crlf)
(test-something)
(printout t "Test done." crlf)
(exit)  